import { Warning, Link } from '@brillout/docpress'

Vike enables you to create your own framework tailored to your company's requirements.

> It's a powerful way to scale your teams, and to ensure a cohesive stack throughout your company. See <Link href="/why#build-your-own-framework" />.

Your framework can include everything (frontend, backend, data fetching, authentication, deployment, error tracking, analytics, ...) so that your Product Developers can focus on what they do best: building user interfaces.


## Getting started

### First step

We recommend getting started by creating a regular Vike app. Once you are satisfied with your stack then progressively move code from the user-land (code inside the app's Git repository) to your framework (code inside `node_modules/my-framework/`).

### Progressively create your framework

Once you are satisfied wit the stack of your regular Vike app, progressively create your framework.

You can achieve that by progressively applying one or more of the following steps:
- Create your own Vike extension that contains all your configuration.
  ```js
  // pages/+config.js

  import react from 'vike-react/config' // [!code --]
  import apollo from 'vike-react-apollo/config' // [!code --]
  import myFramework from 'my-framework/config' // [!code ++]

  export default {
    ssr: false, // [!code --]
    extends: [react, apollo] // [!code --]
    extends: [myFramework] // [!code ++]
  }
  ```
- <Link href="/meta">Create custom settings</Link>, so that your Product Developers can easily configure your framework.
  ```js
  // pages/+config.js

  import myFramework from 'my-framework/config'

  export default {
    myCustomSetting: true,
    extends: [myFramework]
  }
  ```
- Create your own CLI.
  ```json
  // package.json

  {
    "scripts": {
      "dev": "my-framework",
      "build": "my-framework build",
      "preview": "my-framework preview"
    }
  }
  ```
- Move your server code to be built into your framework.
- Move deployment logic to be built into your framework.
  ```json
  // package.json

  {
    "scripts": {
      "dev": "my-framework",
      "build": "my-framework build",
      "preview": "my-framework preview",
      "deploy": "my-framework deploy" // [!code ++]
    }
  }
  ```
- Add utilities to your framework, such as error tracking or analytics.

Feel free to reach out to the Vike team if you have any questions, and sponsorship is welcome for a tight-knit collaboration.
